package classLoading.passiveRefence;

class SuperClass {
    static {
        System.out.println("super class init!");
    }
    protected static int value = 3;
}

class SubClass extends SuperClass {
    static {
        System.out.println("sub class init!");
    }
}

/**
 * 被动引用，子类引用父类的静态属性。不会导致子类被初始化
 * -XX:+TraceClassLoading
 */
public class Demo1 {
    public static void main(String[] args) {
        System.out.println(SubClass.value);
    }
}
